package com.atguigu.decorator;

public class CoffeeBar {
    public static void main(String[] args) {
        Drink order = new LongBlack();
        System.out.println("费用1=" + order.cost());
        System.out.println("描述=" + order.getDescription());

        System.out.println();

        order = new Milk(order);
        System.out.println("order加入一份牛奶,费用=" + order.cost());
        System.out.println("order加入一份牛奶,描述=" + order.getDescription());

        System.out.println();

        order = new Chocolate(order);
        System.out.println("order加入一份牛奶,加入一份巧克力,费用=" + order.cost());
        System.out.println("order加入一份牛奶,加入一份巧克力,描述=" + order.getDescription());

        System.out.println();

        order = new Chocolate(order);
        System.out.println("order加入一份牛奶,加入2份巧克力,费用=" + order.cost());
        System.out.println("order加入一份牛奶,加入2份巧克力,描述= " + order.getDescription());

        System.out.println("===========================");

        Drink order2 = new DeCaf();
        System.out.println("order2无因咖啡,费用=" + order2.cost());
        System.out.println("order2无因咖啡,描述=" + order2.getDescription());

        order2 = new Milk(order2);
        System.out.println("order2无因咖啡,加入一份牛奶,费用=" + order2.cost());
        System.out.println("order2无因咖啡,加入一份牛奶,描述=" + order2.getDescription());
    }
}
